<div class="main f_r">
	<div class="uc_title m_10">
		<label class="current"><span>在线充值</span></label>
	</div>
	<div class="form_content">

		<form action='{url:/block/doPay}' method='post'>
			<table class="border_table" cellpadding="0" cellspacing="0" width='100%'>
				<col width="200px" />
				<col />
				<tr>
					<th>充值金额：</th>
					<td><input type='text' class="small" name="recharge" pattern='float' alt='请输入充值的金额'  /><label>请输入充值的金额</label></td>
				</tr>

				<tr>
					<th>选择充值方式：</th>
					{set:$paymentList=Api::run('getPaymentListByOnline')}
					<td>
						{if:$paymentList}
						{foreach:items = $paymentList}
						<label class='attr'><input class="radio" name="payment_id" title="{$item['name']}" type="radio" value="{$item['id']}" />{$item['name']}</label>
						{$item['note']}，手续费：{if:$item['poundage_type']==2}￥{$item['poundage']}{else:}{$item['poundage']}%{/if}
						<br />
						{/foreach}
						{else:}
						没有线上支付方式
						{/if}
					</td>
				</tr>

				<tr>
					<th></th>
					<td><label class="btn"><input type="submit" value="确定充值" onclick='return check_form();' /></label></td>
				</tr>

			</table>
		</form>
	</div>
</div>

<script type='text/javascript'>

	function check_form()
	{
		if($('[name="payment_id"]:checked').length == 0)
		{
			alert('请选择支付方式');
			return false;
		}

		if($('[name="recharge"]').val() <= 0)
		{
			alert('要充值的金额必须大于0元');
			return false;
		}
	}
</script>